package com.suixuan.support.context;

import java.io.Serializable;

/**
 * 
 * @Copyright (c) Nanjing Zhou Su co.,Ltd
 * 
 * @Project oa
 * @Title IContextHolderStrategy.java
 * @Package com.suixuan.spring.context
 * @Description 上下文件管理接口
 * @Author suixuan
 * @Editors 1
 * @Date 2010-11-22 下午03:47:20
 * @Note
 * @Version:1.0.0
 * 
 */
public interface IContextHolderStrategy extends Serializable {
	/**
	 * Clears the current context.
	 */
	void clearContext();

	/**
	 * Obtains the current context.
	 * 
	 * @return a context (never <code>null</code> - create a default
	 *         implementation if necessary)
	 */
	ContextUsers getContext();

	/**
	 * Sets the current context.
	 * 
	 * @param context
	 *            to the new argument (should never be <code>null</code>,
	 *            although implementations must check if <code>null</code> has
	 *            been passed and throw an <code>IllegalArgumentException</code>
	 *            in such cases)
	 */
	void setContext(ContextUsers context);

	/**
	 * Creates a new, empty context implementation, for use by
	 * <tt>SecurityContextRepository</tt> implementations, when creating a new
	 * context for the first time.
	 * 
	 * @return the empty context.
	 */
	ContextUsers createEmptyContext();
}
